package com.ruoyi.mstore.controller;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.mstore.domain.MaintenanceRecord;
import com.ruoyi.mstore.service.impl.MaintenanceRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/maintenanceRecord")
public class MaintenanceRecordController {
    @Autowired
    private MaintenanceRecordService maintenanceRecordService;

// 通过维修id修改记录状态
    @PutMapping
    public R updateMaintenanceRecord(MaintenanceRecord maintenanceRecord) {
         return R.ok(maintenanceRecordService.updateMaintenanceRecord(maintenanceRecord));
    }


//    @PutMapping
//    public String updateRecordStatus(@RequestParam Long recordId, @RequestParam Integer recordStatus) {
//        int result = maintenanceRecordService.updateRecordStatusByRecordId(recordId, recordStatus);
//        if (result > 0) {
//            return "更新成功";
//        } else {
//            return "更新失败";
//        }
//    }
}
